package response

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type codes int

type ResPonseData struct {
	Code codes       `json:"code"`
	Msg  interface{} `json:"msg"`
	Data interface{} `json:"data"`
}

func ResPonseError(c *gin.Context, data interface{}) {
	c.JSON(http.StatusInternalServerError, &gin.H{
		"code": 500,
		"msg":  "失败",
		"data": data,
	})
}
func ResPonseSuccess(c *gin.Context, data interface{}) {
	c.JSON(http.StatusOK, &gin.H{
		"code": 200,
		"msg":  "成功",
		"data": data,
	})
}
